<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   Editor: 一行R代码来实现繁琐的可视化  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({
          tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
          TeX: {equationNumbers: {autoNumber: "AMS"}}
        });
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466463314: Accept with keywords: (title(0.333333333333):门户网站,代码,统计学,可视化,服务平台,中国, topn(0.366666666667):软件应用,统计图,尺度,标识,R语言,数据挖掘,等包,结果,主站,中文论坛,例子,时间序列,文章,可视化,数据,中国人民大学,软件包,特征向量,对象,聚类,编辑部,会议,统计学,代码,分类,算法,评论,论坛,电子邮件,局部).-->
 </head>
 <body class="single single-post postid-11594 single-format-standard sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    Editor: 一行R代码来实现繁琐的可视化
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/">
       <img src="http://cos.name/wp-content/themes/COS-kermesinus/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <a class="screen-reader-text skip-link" href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/#content" title="跳至内容">
        跳至内容
       </a>
       <div class="menu-%e6%88%91%e7%9a%84%e8%8f%9c%e5%8d%95-container">
        <ul class="nav-menu" id="menu-%e6%88%91%e7%9a%84%e8%8f%9c%e5%8d%95">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-4746" id="menu-item-4746">
          <a href="http://cos.name">
           主页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-8120" id="menu-item-8120">
          <a href="http://cos.name/cn">
           论坛
          </a>
          <ul class="sub-menu">
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8124" id="menu-item-8124">
            <a href="http://cos.name/cn/wp-login.php?action=register">
             论坛注册
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8125" id="menu-item-8125">
            <a href="http://cos.name/cn/wp-login.php">
             论坛登录
            </a>
           </li>
          </ul>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8110" id="menu-item-8110">
          <a href="http://cos.name/books/">
           图书资料
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8112" id="menu-item-8112">
          <a href="http://cos.name/videos">
           视频教程
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8333" id="menu-item-8333">
          <a href="http://cos.name/salon/">
           统计沙龙
          </a>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8111" id="menu-item-8111">
          <a href="http://cos.name/chinar/">
           R语言会议
          </a>
         </li>
         <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8109" id="menu-item-8109">
          <a href="http://cos.name/training/">
           讲座与培训
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8115" id="menu-item-8115">
          <a href="http://cos.name/cn/forum/comprehensive/job/">
           招聘信息
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-4780" id="menu-item-4780">
          <a href="http://cos.name/about">
           关于我们
          </a>
          <ul class="sub-menu">
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8113" id="menu-item-8113">
            <a href="http://cos.name/2008/11/how-to-work-with-cos/">
             加入我们
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8119" id="menu-item-8119">
            <a href="http://cos.name/donate/">
             赞助我们
            </a>
           </li>
           <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-8114" id="menu-item-8114">
            <a href="http://cos.name/cn/forum/26">
             项目合作
            </a>
           </li>
          </ul>
         </li>
        </ul>
       </div>
       <form action="http://cos.name/" class="search-form" method="get" role="search">
        <label>
         <span class="screen-reader-text">
          搜索：
         </span>
        </label>
       </form>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-11594 post type-post status-publish format-standard hentry category-graphics category-software tag-ggfortify tag-ggplot2 tag-911 tag-818" id="post-11594">
        <header class="entry-header">
         <h1 class="entry-title">
          一行R代码来实现繁琐的可视化
         </h1>
         <div class="entry-meta">
          <span class="date">
           <a href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/" rel="bookmark" title="链向一行R代码来实现繁琐的可视化的固定链接">
            <time class="entry-date" datetime="2015-11-24T10:41:34+00:00">
             2015/11/24
            </time>
           </a>
          </span>
          <span class="categories-links">
           <a href="http://cos.name/category/software/graphics/" rel="category tag">
            统计图形
           </a>
           、
           <a href="http://cos.name/category/software/" rel="category tag">
            软件应用
           </a>
          </span>
          <span class="tags-links">
           <a href="http://cos.name/tag/ggfortify/" rel="tag">
            ggfortify
           </a>
           、
           <a href="http://cos.name/tag/ggplot2/" rel="tag">
            ggplot2
           </a>
           、
           <a href="http://cos.name/tag/%e5%8f%af%e8%a7%86%e5%8c%96/" rel="tag">
            可视化
           </a>
           、
           <a href="http://cos.name/tag/%e6%a8%a1%e5%9e%8b/" rel="tag">
            模型
           </a>
          </span>
          <span class="author vcard">
           <a class="url fn n" href="http://cos.name/author/editor/" rel="author" title="查看所有由COS编辑部发布的文章">
            COS编辑部
           </a>
          </span>
         </div>
         <!-- .entry-meta -->
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <p>
          本文作者： 唐源，目前就职于芝加哥一家创业公司，曾参与和创作过多个被广泛使用的 R 和 Python 开源项目，是 ggfortify，lfda，metric-learn 等包的作者，也是 xgboost，caret，pandas 等包的贡献者。（喜欢爬山和烧烤
          <img src="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/0b/tootha_thumb.gif"/>
          ）
         </p>
         <p>
          <a href="https://github.com/sinhrks/ggfortify">
           ggfortify
          </a>
          是一个简单易用的R软件包，它可以仅仅使用
          <strong>
           一行代码
          </strong>
          来对许多受欢迎的R软件包结果进行二维可视化，这让统计学家以及数据科学家省去了许多繁琐和重复的过程，不用对结果进行任何处理就能以
          <code>
           ggplot
          </code>
          的风格画出好看的图，大大地提高了工作的效率。
         </p>
         <p>
          ggfortify 已经可以在
          <a href="https://cran.fhcrc.org/web/packages/ggfortify/index.html">
           CRAN
          </a>
          上下载得到，但是由于最近很多的功能都还在快速增加，因此还是推荐大家从
          <a href="https://github.com/sinhrks/ggfortify">
           Github
          </a>
          上下载和安装。
         </p>
         <pre><code class="r">library(devtools)
install_github('sinhrks/ggfortify')
library(ggfortify)</code></pre>
         <p>
          接下来我将简单介绍一下怎么用
          <code>
           ggplot2
          </code>
          和
          <code>
           ggfortify
          </code>
          来很快地对PCA、聚类以及LFDA的结果进行可视化，然后将简单介绍用
          <code>
           ggfortify
          </code>
          来对时间序列进行快速可视化的方法。
         </p>
         <h2>
          PCA (主成分分析)
         </h2>
         <p>
          <code>
           ggfortify
          </code>
          使
          <code>
           ggplot2
          </code>
          知道怎么诠释PCA对象。加载好
          <code>
           ggfortify
          </code>
          包之后, 你可以对
          <code>
           stats::prcomp
          </code>
          和
          <code>
           stats::princomp
          </code>
          对象使用
          <code>
           ggplot2::autoplot
          </code>
          。
         </p>
         <pre><code class="r">library(ggfortify)
df &lt;- iris[c(1, 2, 3, 4)]
autoplot(prcomp(df))</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-1-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-1-1-500x250.png"/>
          </a>
          你还可以选择数据中的一列来给画出的点按类别自动分颜色。输入
          <code>
           help(autoplot.prcomp)
          </code>
          可以了解到更多的其他选择。
         </p>
         <pre><code class="r">autoplot(prcomp(df), data = iris, colour = 'Species')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-2-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-2-1-500x250.png"/>
          </a>
          比如说给定
          <code>
           label = TRUE
          </code>
          可以给每个点加上标识（以
          <code>
           rownames
          </code>
          为标准），也可以调整标识的大小。
         </p>
         <pre><code class="r">autoplot(prcomp(df), data = iris, colour = 'Species', label = TRUE,
         label.size = 3)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-3-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-3-1-500x250.png"/>
          </a>
          给定
          <code>
           shape = FALSE
          </code>
          可以让所有的点消失，只留下标识，这样可以让图更清晰，辨识度更大。
         </p>
         <pre><code class="r">autoplot(prcomp(df), data = iris, colour = 'Species', shape = FALSE,
         label.size = 3)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-4-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-4-1-500x250.png"/>
          </a>
         </p>
         <p>
          <span id="more-11594">
          </span>
          给定
          <code>
           loadings = TRUE
          </code>
          可以很快地画出特征向量。
         </p>
         <pre><code class="r">autoplot(prcomp(df), data = iris, colour = 'Species', loadings = TRUE)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-5-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-5-1-500x250.png"/>
          </a>
          同样的，你也可以显示特征向量的标识以及调整他们的大小，更多选择请参考帮助文件。
         </p>
         <pre><code class="r">autoplot(prcomp(df), data = iris, colour = 'Species',
         loadings = TRUE, loadings.colour = 'blue',
         loadings.label = TRUE, loadings.label.size = 3)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-6-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-6-1-500x250.png"/>
          </a>
         </p>
         <h2>
          因子分析
         </h2>
         <p>
          和PCA类似，
          <code>
           ggfortify
          </code>
          也支持
          <code>
           stats::factanal
          </code>
          对象。可调的选择也很广泛。以下给出了简单的例子：
         </p>
         <p>
          <strong>
           注意
          </strong>
          当你使用
          <code>
           factanal
          </code>
          来计算分数的话，你必须给定
          <code>
           scores
          </code>
          的值。
         </p>
         <pre><code class="r">d.factanal &lt;- factanal(state.x77, factors = 3, scores = 'regression')
autoplot(d.factanal, data = state.x77, colour = 'Income')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-7-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-7-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(d.factanal, label = TRUE, label.size = 3,
         loadings = TRUE, loadings.label = TRUE, loadings.label.size  = 3)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-7-2.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-7-2-500x250.png"/>
          </a>
         </p>
         <h2>
          K-均值聚类
         </h2>
         <pre><code class="r">autoplot(kmeans(USArrests, 3), data = USArrests)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-8-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-8-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(kmeans(USArrests, 3), data = USArrests, label = TRUE, 
         label.size = 3)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-8-2.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-8-2-500x250.png"/>
          </a>
         </p>
         <h2>
          其他聚类
         </h2>
         <p>
          <code>
           ggfortify
          </code>
          也支持
          <code>
           cluster::clara
          </code>
          ,
          <code>
           cluster::fanny
          </code>
          ,
          <code>
           cluster::pam
          </code>
          。
         </p>
         <pre><code class="r">library(cluster)
autoplot(clara(iris[-5], 3))</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-9-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-9-1-500x250.png"/>
          </a>
          给定
          <code>
           frame = TRUE
          </code>
          ，可以把
          <code>
           stats::kmeans
          </code>
          和
          <code>
           cluster::*
          </code>
          中的每个类圈出来。
         </p>
         <pre><code class="r">autoplot(fanny(iris[-5], 3), frame = TRUE)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-10-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-10-1-500x250.png"/>
          </a>
          你也可以通过
          <code>
           frame.type
          </code>
          来选择圈的类型。更多选择请参照
          <a href="http://docs.ggplot2.org/dev/stat_ellipse.html">
           <code>
            ggplot2::stat_ellipse
           </code>
          </a>
          里面的
          <code>
           frame.type
          </code>
          的
          <code>
           type
          </code>
          关键词。
         </p>
         <pre><code class="r">autoplot(pam(iris[-5], 3), frame = TRUE, frame.type = 'norm')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-11-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-11-1-500x250.png"/>
          </a>
          更多关于聚类方面的可视化请参考 Github 上的
          <a href="https://github.com/sinhrks/ggfortify/tree/master/vignettes">
           Vignette
          </a>
          或者
          <a href="http://rpubs.com/sinhrks/plot_pca">
           Rpubs
          </a>
          上的例子。
         </p>
         <h2>
          lfda（Fisher局部判别分析）
         </h2>
         <p>
          <a href="https://cran.r-project.org/web/packages/lfda/index.html">
           <code>
            lfda
           </code>
          </a>
          包支持一系列的 Fisher 局部判别分析方法，包括半监督 lfda，非线性 lfda。你也可以使用
          <code>
           ggfortify
          </code>
          来对他们的结果进行可视化。
         </p>
         <pre><code class="r">library(lfda)
# Fisher局部判别分析 (LFDA)
model &lt;- lfda(iris[-5], iris[, 5], 4, metric="plain")
autoplot(model, data = iris, frame = TRUE, frame.colour = 'Species')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-12-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-12-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r"># 非线性核Fisher局部判别分析 (KLFDA)
model &lt;- klfda(kmatrixGauss(iris[-5]), iris[, 5], 4, metric="plain")
autoplot(model, data = iris, frame = TRUE, frame.colour = 'Species')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-12-2.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-12-2-500x250.png"/>
          </a>
          <strong>
           注意
          </strong>
          对
          <code>
           iris
          </code>
          数据来说，不同的类之间的关系很显然不是简单的线性，这种情况下非线性的klfda 影响可能太强大而影响了可视化的效果，在使用前请充分理解每个算法的意义以及效果。
         </p>
         <pre><code class="r"># 半监督Fisher局部判别分析 (SELF)
model &lt;- self(iris[-5], iris[, 5], beta = 0.1, r = 3, metric="plain")
autoplot(model, data = iris, frame = TRUE, frame.colour = 'Species')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-13-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-13-1-500x250.png"/>
          </a>
         </p>
         <h2>
          时间序列的可视化
         </h2>
         <p>
          用
          <code>
           ggfortify
          </code>
          可以使时间序列的可视化变得极其简单。接下来我将给出一些简单的例子。
         </p>
         <h3>
          ts对象
         </h3>
         <pre><code class="r">library(ggfortify)
autoplot(AirPassengers)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-14-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-14-1-500x250.png"/>
          </a>
          可以使用
          <code>
           ts.colour
          </code>
          和
          <code>
           ts.linetype
          </code>
          来改变线的颜色和形状。更多的选择请参考
          <code>
           help(autoplot.ts)
          </code>
          。
         </p>
         <pre><code class="r">autoplot(AirPassengers, ts.colour = 'red', ts.linetype = 'dashed')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-15-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-15-1-500x250.png"/>
          </a>
         </p>
         <h2>
          多变量时间序列
         </h2>
         <pre><code class="r">library(vars)
data(Canada)
autoplot(Canada)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-16-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-16-1-500x250.png"/>
          </a>
          使用
          <code>
           facets = FALSE
          </code>
          可以把所有变量画在一条轴上。
         </p>
         <pre><code class="r">autoplot(Canada, facets = FALSE)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-17-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-17-1-500x250.png"/>
          </a>
         </p>
         <p>
          <code>
           autoplot
          </code>
          也可以理解其他的时间序列类别。可支持的R包有：
         </p>
         <ul>
          <li>
           <code>
            zoo::zooreg
           </code>
          </li>
          <li>
           <code>
            xts::xts
           </code>
          </li>
          <li>
           <code>
            timeSeries::timSeries
           </code>
          </li>
          <li>
           <code>
            tseries::irts
           </code>
          </li>
         </ul>
         <p>
          一些例子：
         </p>
         <pre><code class="r">library(xts)
autoplot(as.xts(AirPassengers), ts.colour = 'green')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-18-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-18-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">library(timeSeries)
autoplot(as.timeSeries(AirPassengers), ts.colour = ('dodgerblue3'))</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-18-2.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-18-2-500x250.png"/>
          </a>
          你也可以通过
          <code>
           ts.geom
          </code>
          来改变几何形状，目前支持的有
          <code>
           line
          </code>
          ，
          <code>
           bar
          </code>
          和
          <code>
           point。
          </code>
         </p>
         <pre><code class="r">autoplot(AirPassengers, ts.geom = 'bar', fill = 'blue')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-19-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-19-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(AirPassengers, ts.geom = 'point', shape = 3)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-20-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-20-1-500x250.png"/>
          </a>
         </p>
         <h2>
          forecast包
         </h2>
         <pre><code class="r">library(forecast)
d.arima &lt;- auto.arima(AirPassengers)
d.forecast &lt;- forecast(d.arima, level = c(95), h = 50)
autoplot(d.forecast)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-21-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-21-1-500x250.png"/>
          </a>
          有很多设置可供调整：
         </p>
         <pre><code class="r">autoplot(d.forecast, ts.colour = 'firebrick1', predict.colour = 'red',
         predict.linetype = 'dashed', conf.int = FALSE)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-22-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-22-1-500x250.png"/>
          </a>
         </p>
         <h2>
          vars包
         </h2>
         <pre><code class="r">library(vars)
data(Canada)
d.vselect &lt;- VARselect(Canada, lag.max = 5, type = 'const')$selection[1]
d.var &lt;- VAR(Canada, p = d.vselect, type = 'const')
autoplot(predict(d.var, n.ahead = 50), ts.colour = 'dodgerblue4',
         predict.colour = 'blue', predict.linetype = 'dashed')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-24-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-24-1-500x250.png"/>
          </a>
         </p>
         <h2>
          changepoint包
         </h2>
         <pre><code class="r">library(changepoint)
autoplot(cpt.meanvar(AirPassengers))</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-25-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-25-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(cpt.meanvar(AirPassengers), cpt.colour = 'blue', cpt.linetype = 'solid')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-26-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-26-1-500x250.png"/>
          </a>
         </p>
         <h2>
          strucchange包
         </h2>
         <pre><code class="r">library(strucchange)
autoplot(breakpoints(Nile ~ 1), ts.colour = 'blue', ts.linetype = 'dashed',
         cpt.colour = 'dodgerblue3', cpt.linetype = 'solid')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-27-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-27-1-500x250.png"/>
          </a>
         </p>
         <h2>
          dlm包
         </h2>
         <pre><code class="r">library(dlm)
form &lt;- function(theta){
  dlmModPoly(order = 1, dV = exp(theta[1]), dW = exp(theta[2]))
}

model &lt;- form(dlmMLE(Nile, parm = c(1, 1), form)$par)
filtered &lt;- dlmFilter(Nile, model)

autoplot(filtered)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-28-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-28-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(filtered, ts.linetype = 'dashed', fitted.colour = 'blue')</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-29-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-29-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">smoothed &lt;- dlmSmooth(filtered)
autoplot(smoothed)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-30-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-30-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">p &lt;- autoplot(filtered)
autoplot(smoothed, ts.colour = 'blue', p = p)</code></pre>
         <h2>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-31-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-31-1-500x250.png"/>
          </a>
          KFAS包
         </h2>
         <pre><code class="r">library(KFAS)
model &lt;- SSModel(
  Nile ~ SSMtrend(degree=1, Q=matrix(NA)), H=matrix(NA)
)
 
fit &lt;- fitSSM(model=model, inits=c(log(var(Nile)),log(var(Nile))), 
              method="BFGS")
smoothed &lt;- KFS(fit$model)
autoplot(smoothed)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-32-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-32-1-500x250.png"/>
          </a>
          使用
          <code>
           smoothing='none'
          </code>
          可以画出过滤后的结果。
         </p>
         <pre><code class="r">filtered &lt;- KFS(fit$model, filtering="mean", smoothing='none')
autoplot(filtered)</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-33-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-33-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">trend &lt;- signal(smoothed, states="trend")
p &lt;- autoplot(filtered)
autoplot(trend, ts.colour = 'blue', p = p)</code></pre>
         <p>
         </p>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-35-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-35-1-500x250.png"/>
          </a>
         </p>
         <h1>
          stats包
         </h1>
         <p>
          可支持的stats包里的对象有：
         </p>
         <ul>
          <li>
           <code>
            stl
           </code>
           ,
           <code>
            decomposed.ts
           </code>
          </li>
          <li>
           <code>
            acf
           </code>
           ,
           <code>
            pacf
           </code>
           ,
           <code>
            ccf
           </code>
          </li>
          <li>
           <code>
            spec.ar
           </code>
           ,
           <code>
            spec.pgram
           </code>
          </li>
          <li>
           <code>
            cpgram
           </code>
          </li>
         </ul>
         <pre><code class="r">autoplot(stl(AirPassengers, s.window = 'periodic'), ts.colour = 'blue')
</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-36-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-36-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(acf(AirPassengers, plot = FALSE))
</code></pre>
         <p>
         </p>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-37-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-37-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(acf(AirPassengers, plot = FALSE), conf.int.fill = '#0000FF', 
         conf.int.value = 0.8, conf.int.type = 'ma')</code></pre>
         <p>
         </p>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-38-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-38-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">autoplot(spec.ar(AirPassengers, plot = FALSE))</code></pre>
         <p>
         </p>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-39-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-39-1-500x250.png"/>
          </a>
         </p>
         <pre><code class="r">ggcpgram(arima.sim(list(ar = c(0.7, -0.5)), n = 50))</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-40-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-40-1-500x500.png"/>
          </a>
         </p>
         <pre><code class="r">library(forecast)
ggtsdiag(auto.arima(AirPassengers))</code></pre>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-41-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-41-1-500x500.png"/>
          </a>
         </p>
         <pre><code class="r">gglagplot(AirPassengers, lags = 4)</code></pre>
         <p>
         </p>
         <p>
          <a href="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-42-1.png">
           <img src="http://cos.name/wp-content/uploads/2015/11/ggfortify-unnamed-chunk-42-1-500x500.png"/>
          </a>
         </p>
         <p>
          更多关于时间序列的例子，请参考
          <a href="http://rpubs.com/sinhrks/plot_ts">
           Rpubs
          </a>
          上的介绍。
         </p>
         <p>
          最近又多了许多额外的非常好用的功能，比如说现在已经支持
          <code>
           multiplot
          </code>
          同时画多个不同对象，强烈推荐参考
          <a href="http://rpubs.com/sinhrks/ggfortify_subplots">
           Rpubs
          </a>
          以及关注我们
          <a href="https://github.com/sinhrks/ggfortify">
           Github
          </a>
          上的更新。
         </p>
         <p>
          祝大家使用愉快！有问题请及时在Github上
          <a href="https://github.com/sinhrks/ggfortify/issues">
           报告
          </a>
          。(可以使用中文)
         </p>
         <div class="wumii-hook">
          <br/>
          <br/>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
         <div class="author-info">
          <div class="author-avatar">
           <img src="http://sdn.geekzu.org/avatar/2fe058e9e383c85afa949b36e869432f?s=74&amp;d=monsterid&amp;r=g"/>
          </div>
          <!-- .author-avatar -->
          <div class="author-description">
           <h2 class="author-title">
            关于COS编辑部
           </h2>
           <p class="author-bio">
            本账户为COS编辑部公共账户，目前由朱雪宁任主编，王小宁任副主编，编辑有：冯璟烁、吴佳萍、张心雨、施涛、霍志骥、何通、冷静、尤晓斌、肖楠、邱怡轩、高涛、谢益辉等人，主要负责主站文章的规范化编辑以及相关论文、书籍、手册的整理、编纂、出版等工作。
            <a class="author-link" href="http://cos.name/author/editor/" rel="author">
             查看所有由COS编辑部发表的文章
             <span class="meta-nav">
              →
             </span>
            </a>
           </p>
          </div>
          <!-- .author-description -->
         </div>
         <!-- .author-info -->
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <nav class="navigation post-navigation" role="navigation">
        <h1 class="screen-reader-text">
         文章导航
        </h1>
        <div class="nav-links">
         <a href="http://cos.name/2015/11/20151108salon/" rel="prev">
          <span class="meta-nav">
           ←
          </span>
          COS沙龙第32期（北京）纪要
         </a>
         <a href="http://cos.name/2015/11/8th-china-r-nanchang-summary/" rel="next">
          第八届中国R语言会议（南昌会场）暨江西财经大学第一届金融大数据论坛纪要
          <span class="meta-nav">
           →
          </span>
         </a>
        </div>
        <!-- .nav-links -->
       </nav>
       <!-- .navigation -->
       <div class="comments-area" id="comments">
        <h2 class="comments-title">
         《
         <span>
          一行R代码来实现繁琐的可视化
         </span>
         》有6个想法
        </h2>
        <ol class="comment-list">
         <li class="pingback even thread-even depth-1" id="comment-6954">
          <div class="comment-body">
           Pingback：
           <a class="url" href="http://blog.shenwei.me/r-learning-resources/" rel="external nofollow">
            R Learning Resources | Wei Shen's Note
           </a>
          </div>
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-odd thread-alt depth-1 parent" id="comment-6956">
          <article class="comment-body" id="div-comment-6956">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/362f64d907520f9ee23103725d3ed4cb?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              <a class="url" href="http://ttang.name" rel="external nofollow">
               ttang
              </a>
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/#comment-6956">
              <time datetime="2015-11-24T20:52:34+00:00">
               2015/11/24 20:52
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             这个是不是太太太。。。夸张了点？
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给ttang" class="comment-reply-link" href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/?replytocom=6956#respond" onclick='return addComment.moveForm( "div-comment-6956", "6956", "respond", "11594" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
          <ol class="children">
           <li class="comment even depth-2" id="comment-6957">
            <article class="comment-body" id="div-comment-6957">
             <footer class="comment-meta">
              <div class="comment-author vcard">
               <img src="http://sdn.geekzu.org/avatar/76304c4b2eb84ea884a566f45f4adc13?s=74&amp;d=monsterid&amp;r=g"/>
               <b class="fn">
                leengsmile
               </b>
               <span class="says">
                说道：
               </span>
              </div>
              <!-- .comment-author -->
              <div class="comment-metadata">
               <a href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/#comment-6957">
                <time datetime="2015-11-24T23:00:16+00:00">
                 2015/11/24 23:00
                </time>
               </a>
              </div>
              <!-- .comment-metadata -->
             </footer>
             <!-- .comment-meta -->
             <div class="comment-content">
              <p>
               恩，太牛逼了
              </p>
             </div>
             <!-- .comment-content -->
             <div class="reply">
              <a aria-label="回复给leengsmile" class="comment-reply-link" href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/?replytocom=6957#respond" onclick='return addComment.moveForm( "div-comment-6957", "6957", "respond", "11594" )' rel="nofollow">
               回复
              </a>
             </div>
            </article>
            <!-- .comment-body -->
           </li>
           <!-- #comment-## -->
          </ol>
          <!-- .children -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-6995">
          <article class="comment-body" id="div-comment-6995">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/e7f6e984b052c57e337ac4ece0fdb8e2?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              kekeke
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/#comment-6995">
              <time datetime="2015-12-15T20:30:57+00:00">
               2015/12/15 20:30
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             太厉害了。。。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给kekeke" class="comment-reply-link" href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/?replytocom=6995#respond" onclick='return addComment.moveForm( "div-comment-6995", "6995", "respond", "11594" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment even thread-odd thread-alt depth-1" id="comment-7011">
          <article class="comment-body" id="div-comment-7011">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/2cb71706017f27e098a1b8f9ec6a8e40?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              刘冬
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/#comment-7011">
              <time datetime="2015-12-28T10:42:52+00:00">
               2015/12/28 10:42
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             有一个问题：在一个图上画两个序列时，如果两个序列的纵坐标尺度不同，用两个y轴怎么显示，比如：左边y轴是一个尺度，右边y轴是另一个尺度。
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给刘冬" class="comment-reply-link" href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/?replytocom=7011#respond" onclick='return addComment.moveForm( "div-comment-7011", "7011", "respond", "11594" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
         <li class="comment odd alt thread-even depth-1" id="comment-7275">
          <article class="comment-body" id="div-comment-7275">
           <footer class="comment-meta">
            <div class="comment-author vcard">
             <img src="http://sdn.geekzu.org/avatar/eea93020a4a2412be14dfed917e4b54b?s=74&amp;d=monsterid&amp;r=g"/>
             <b class="fn">
              Caiyao
             </b>
             <span class="says">
              说道：
             </span>
            </div>
            <!-- .comment-author -->
            <div class="comment-metadata">
             <a href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/#comment-7275">
              <time datetime="2016-06-03T15:13:33+00:00">
               2016/06/03 15:13
              </time>
             </a>
            </div>
            <!-- .comment-metadata -->
           </footer>
           <!-- .comment-meta -->
           <div class="comment-content">
            <p>
             好强大呀~~
             <br/>
             慢慢学习
             <br/>
             能收藏起来就好了O(∩_∩)O
            </p>
           </div>
           <!-- .comment-content -->
           <div class="reply">
            <a aria-label="回复给Caiyao" class="comment-reply-link" href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/?replytocom=7275#respond" onclick='return addComment.moveForm( "div-comment-7275", "7275", "respond", "11594" )' rel="nofollow">
             回复
            </a>
           </div>
          </article>
          <!-- .comment-body -->
         </li>
         <!-- #comment-## -->
        </ol>
        <!-- .comment-list -->
        <div class="comment-respond" id="respond">
         <h3 class="comment-reply-title" id="reply-title">
          发表评论
          <small>
           <a href="http://cos.name/2015/11/ggfortify-visualization-in-one-line-of-code/#respond" id="cancel-comment-reply-link" rel="nofollow" style="display:none;">
            取消回复
           </a>
          </small>
         </h3>
         <form action="http://cos.name/wp-comments-post.php" class="comment-form" id="commentform" method="post" novalidate="">
          <p class="comment-notes">
           <span id="email-notes">
            电子邮件地址不会被公开。
           </span>
           必填项已用
           <span class="required">
            *
           </span>
           标注
          </p>
          <p class="comment-form-comment">
           <label for="comment">
            评论
           </label>
           <textarea aria-required="true" cols="45" id="comment" maxlength="65525" name="comment" required="required" rows="8">
           </textarea>
          </p>
          <p class="comment-form-author">
           <label for="author">
            姓名
            <span class="required">
             *
            </span>
           </label>
          </p>
          <p class="comment-form-email">
           <label for="email">
            电子邮件
            <span class="required">
             *
            </span>
           </label>
          </p>
          <p class="comment-form-url">
           <label for="url">
            站点
           </label>
          </p>
          <p class="form-submit">
          </p>
          <p style="display: none;">
          </p>
          <p style="display: none;">
          </p>
         </form>
        </div>
        <!-- #respond -->
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          关注统计之都
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            新浪微博
            <a href="http://weibo.com/cosname">
             @统计之都
            </a>
           </li>
           <li>
            人人网
            <a href="http://renren.com/cosname">
             @统计之都
            </a>
           </li>
           <li>
            Twitter
            <a href="http://twitter.com/cos_name">
             @cos_name
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-6">
         <h3 class="widget-title">
          微信公众平台
         </h3>
         <div class="textwidget">
          <img src="http://cos.name/wp-content/uploads/2013/04/qrcode-8cm.jpg"/>
          <p style="font-size:12px;margin-left:15px">
           微信号 CapStat
          </p>
          <p>
           我们将第一时间向您推送主站和论坛的精彩内容，以及统计之都的线下活动、竞赛、培训和会议信息。
          </p>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-8">
         <h3 class="widget-title">
          站内导航
         </h3>
         <div class="textwidget">
          <ul>
           <li class="page_item">
            <a href="http://cos.name/cn/">
             中文论坛
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/videos/">
             视频
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/salon/">
             统计沙龙
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/books/">
             图书出版
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/training/">
             教育培训
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/about/">
             关于我们
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/donate/">
             捐赠
            </a>
           </li>
           <li class="page_item">
            <a href="http://cos.name/chinar/">
             R语言会议
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_links" id="linkcat-2">
         <h3 class="widget-title">
          友情链接
         </h3>
         <ul class="xoxo blogroll">
          <li>
           <a href="http://stat.ruc.edu.cn" target="_blank" title="中国人民大学统计学院网站">
            中国人民大学统计学院
           </a>
          </li>
          <li>
           <a href="http://rucdmc.net">
            中国人民大学数据挖掘中心
           </a>
          </li>
          <li>
           <a href="http://birc.gsm.pku.edu.cn/" target="_blank">
            北京大学商务智能研究中心
           </a>
          </li>
          <li>
           <a href="http://sam.cufe.edu.cn/" target="_blank" title="中央财经大学统计与数学学院网站">
            中央财经大学统计与数学学院
           </a>
          </li>
          <li>
           <a href="http://tjx.cueb.edu.cn/" target="_blank" title="首都经济贸易大学统计学院网站">
            首经贸统计学院
           </a>
          </li>
          <li>
           <a href="http://www.shookr.com/">
            数客网大数据社区
           </a>
          </li>
          <li>
           <a href="http://www.xueqing.tv/" target="_blank" title="数据科学在线学习平台">
            雪晴数据网
           </a>
          </li>
          <li>
           <a href="http://iera.name/" target="_blank" title="IERA是一个旨在普及、传播和增进工业工程知识的非营利性网站">
            IERA（直通IE）
           </a>
          </li>
         </ul>
        </aside>
        <aside class="widget widget_categories" id="categories-2">
         <h3 class="widget-title">
          全部分类
         </h3>
         <label class="screen-reader-text" for="cat">
          全部分类
         </label>
         <select class="postform" id="cat" name="cat">
          <option value="-1">
           选择分类目录
          </option>
          <option class="level-0" value="925">
           cos访谈  (4)
          </option>
          <option class="level-0" value="659">
           图书出版  (5)
          </option>
          <option class="level-0" value="379">
           数学方法  (14)
          </option>
          <option class="level-1" value="381">
           分析与代数  (1)
          </option>
          <option class="level-1" value="380">
           概率论  (9)
          </option>
          <option class="level-1" value="382">
           随机过程  (5)
          </option>
          <option class="level-0" value="210">
           数据分析  (81)
          </option>
          <option class="level-1" value="203">
           多元统计  (3)
          </option>
          <option class="level-1" value="42">
           数据挖掘与机器学习  (42)
          </option>
          <option class="level-1" value="36">
           生物与医学统计  (17)
          </option>
          <option class="level-1" value="35">
           计量经济学  (4)
          </option>
          <option class="level-1" value="296">
           金融统计  (3)
          </option>
          <option class="level-1" value="303">
           风险精算  (7)
          </option>
          <option class="level-0" value="177">
           模型专题  (15)
          </option>
          <option class="level-1" value="38">
           回归分析  (10)
          </option>
          <option class="level-1" value="41">
           时间序列  (2)
          </option>
          <option class="level-0" value="784">
           每周精选  (24)
          </option>
          <option class="level-1" value="183">
           可视化  (9)
          </option>
          <option class="level-0" value="967">
           沙龙纪要  (3)
          </option>
          <option class="level-0" value="18">
           经典理论  (46)
          </option>
          <option class="level-1" value="37">
           抽样调查  (3)
          </option>
          <option class="level-1" value="4">
           统计推断  (26)
          </option>
          <option class="level-1" value="236">
           试验设计  (7)
          </option>
          <option class="level-1" value="39">
           非参数统计  (3)
          </option>
          <option class="level-0" value="1">
           统计之都  (279)
          </option>
          <option class="level-1" value="884">
           中国R会议  (2)
          </option>
          <option class="level-1" value="885">
           中国R语言会议  (5)
          </option>
          <option class="level-1" value="446">
           出国留学  (3)
          </option>
          <option class="level-1" value="179">
           推荐文章  (90)
          </option>
          <option class="level-1" value="3">
           新闻通知  (75)
          </option>
          <option class="level-1" value="263">
           统计刊物  (10)
          </option>
          <option class="level-1" value="174">
           网站导读  (40)
          </option>
          <option class="level-1" value="204">
           职业事业  (51)
          </option>
          <option class="level-1" value="213">
           高校课堂  (9)
          </option>
          <option class="level-0" value="178">
           统计计算  (28)
          </option>
          <option class="level-1" value="40">
           优化与模拟  (15)
          </option>
          <option class="level-1" value="43">
           贝叶斯方法  (6)
          </option>
          <option class="level-0" value="378">
           软件应用  (116)
          </option>
          <option class="level-1" value="44">
           统计图形  (36)
          </option>
          <option class="level-1" value="110">
           统计软件  (83)
          </option>
         </select>
        </aside>
        <aside class="widget widget_recent_comments" id="recent-comments-2">
         <h3 class="widget-title">
          最新评论
         </h3>
         <ul id="recentcomments">
          <li class="recentcomments">
           <span class="comment-author-link">
            fineboom
           </span>
           发表在《
           <a href="http://cos.name/2016/06/use-shiny-fleetly-set-up-visual-prototype-system/#comment-7317">
            利用shiny包快速搭建可视化原型系统
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            胡家新
           </span>
           发表在《
           <a href="http://cos.name/2016/06/r%e8%af%ad%e5%8d%83%e5%af%bb%e7%ac%ac%e4%b8%89%e6%9c%9f%ef%bc%9a%e5%bc%a0%e6%97%a0%e5%bf%8c%e7%a9%b6%e7%ab%9f%e7%88%b1%e8%b0%81%ef%bc%9f/#comment-7316">
            R语千寻第三期：张无忌究竟爱谁？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            <a class="url" href="http://www.zijiacha.com/category.php?id=6" rel="external nofollow">
             南糯山普洱茶
            </a>
           </span>
           发表在《
           <a href="http://cos.name/2016/06/r%e8%af%ad%e5%8d%83%e5%af%bb%e7%ac%ac%e4%b8%89%e6%9c%9f%ef%bc%9a%e5%bc%a0%e6%97%a0%e5%bf%8c%e7%a9%b6%e7%ab%9f%e7%88%b1%e8%b0%81%ef%bc%9f/#comment-7315">
            R语千寻第三期：张无忌究竟爱谁？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            J
           </span>
           发表在《
           <a href="http://cos.name/2016/05/value-of-the-reputation-from-the-data/#comment-7314">
            数据告诉你：高信誉的卖家应该收高价，还是收低价？
           </a>
           》
          </li>
          <li class="recentcomments">
           <span class="comment-author-link">
            <a class="url" href="http://gg" rel="external nofollow">
             Hilda
            </a>
           </span>
           发表在《
           <a href="http://cos.name/2013/01/drawing-map-in-r-era/#comment-7311">
            R时代，你要怎样画地图？
           </a>
           》
          </li>
         </ul>
        </aside>
        <aside class="widget widget_rss" id="rss-282869971">
         <h3 class="widget-title">
          <a class="rsswidget" href="http://cos.name/cn/topics/feed/">
           <img src="http://cos.name/wp-includes/images/rss.png"/>
          </a>
          <a class="rsswidget" href="http://cos.name/cn/topics/feed/">
           中文论坛新帖
          </a>
         </h3>
         <ul>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/417372/">
            处理时间数据和产生时间序列的问题
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/6790/">
            《统计陷阱》下载 （How to lie with statistics）
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/818/">
            统计学的世界（第五版）
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/16574/">
            class(x) 返回值值是AsIs,AsIs代表什么，有什么用处？
           </a>
          </li>
          <li>
           <a class="rsswidget" href="http://cos.name/cn/topic/417366/">
            如何用R绘制一个分类算法的决策规则
           </a>
          </li>
         </ul>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          登录/RSS
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/wp-admin/">
             登录
            </a>
           </li>
           <li>
            <a href="http://cos.name/feed/" title="使用 RSS 2.0 同步站点内容">
             文章
             <abbr title="Really Simple Syndication">
              RSS
             </abbr>
            </a>
           </li>
           <li>
            <a href="http://cos.name/comments/feed/" title="RSS 上的最近评论">
             评论
             <abbr title="Really Simple Syndication">
              RSS
             </abbr>
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
   <p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <a href="http://www.wumii.com/widget/relatedItems" style="border:0;">
     <img src="http://static.wumii.cn/images/pixel.png"/>
    </a>
   </p>
  </div>
 </body>
</html>